package com.wp.controller;

import com.wp.entity.student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: WangPeng
 * @createTime: 2022/11/15 14:47
 * @description:
 * @version: v1.0
 */
@RestController
public class HelloController {

    @GetMapping("/hello")
    public String hello(){
        return "Hello SpringBoot!";
    }

    @Autowired
    private student student;
    @GetMapping("/getStudent")
    public student getStudent(){
        return student;
    }

    @Value("${people.name}")
    private String name;
    @Value("${people.address}")
    private String address;
    @Value("${people.hobby}")
    private String hobby;
    @GetMapping("/getMassage")
    public String getMessage(){
        return name+"住在"+address+"喜欢"+hobby;
    }
}
